﻿/*----------------------------------------------------------------
// Copyright (C) 2011 上海
// 版权所有。 
//
// 文件名：IngredientsDetailedAbstract
// 文件功能描述：食材明细实体
//
// 
// 创建标识：2012-01-14 zhou
//
// 修改标识：
// 修改描述：
//
//
//----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using DAO.WaiGaoQiao;

namespace Model.WaiGaoQiao
{
    public abstract class IngredientsDetailedAbstract
    {
        /// <summary>
        /// ID自增主键
        /// </summary>
        public int ID
        {
            get;
            set;
        }
        /// <summary>
        /// 入库日期
        /// </summary>
        public DateTime InstockDt
        {
            get;
            set;
        }
        /// <summary>
        /// 仓库
        /// </summary>
        public int Warehouse_ID
        {
            get;
            set;
        }
        /// <summary>
        /// 班组
        /// </summary>
        public int Group_ID
        {
            get;
            set;
        }
        /// <summary>
        /// 食材
        /// </summary>
        public int Goods_ID
        {
            get;
            set;
        }
        /// <summary>
        /// 数量
        /// </summary>
        public decimal Count
        {
            get;
            set;
        }
        /// <summary>
        /// 单价
        /// </summary>
        public decimal Price
        {
            get;
            set;
        }
        /// <summary>
        /// 金额
        /// </summary>
        public decimal Amount
        {
            get;
            set;
        }
        /// <summary>
        /// 供应商
        /// </summary>
        public int Supplier_ID
        {
            get;
            set;
        }
        /// <summary>
        /// 记录时间
        /// </summary>
        public DateTime RecordDateTime
        {
            get;
            set;
        }
        /// <summary>
        /// 经办人
        /// </summary>
        public string OperatorID
        {
            get;
            set;
        }

        /// <summary>
        /// 订单编号
        /// </summary>
        public string OrderNo
        {
            get;
            set;
        }

        protected DataAccessInstockDetailed DAID
        {
            get;
            set;
        }
        protected int rowcount;

        public int _rowcount
        {
            get { return rowcount; }
        }

        /// <summary>
        /// 保存食材明细
        /// </summary>
        /// <param name="idpara"></param>
        /// <returns></returns>
        public abstract int SaveInstockDetailed(IngredientsDetailedAbstract idab);

        /// <summary>
        /// 食材明细总数
        /// </summary>
        /// <returns></returns>
        public abstract int GetCountInstockDetailed(string condition);

        /// <summary>
        /// 获取食材明细不分页
        /// </summary>
        /// <param name="condition"></param>
        /// <returns></returns>
        public abstract IList<IngredientsDetailedAbstract> GetAllInstockDetailed(string condition);

        /// <summary>
        /// 获取食材明细分页
        /// </summary>
        /// <param name="condition"></param>
        /// <param name="pagesize"></param>
        /// <param name="startindex"></param>
        /// <returns></returns>
        public abstract IList<IngredientsDetailedAbstract> GetAllInstockDetailed(string condition, int pagesize, int startindex);

        /// <summary>
        /// 根据条件删除
        /// </summary>
        /// <param name="condition"></param>
        /// <returns></returns>
        public abstract int DeleteInstockDetailed(string condition);

        /// <summary>
        /// 生成批量输入编号
        /// </summary>
        /// <returns></returns>
        public virtual string BuliderOrderNo()
        {
            return DAID.GetInstockDetailedOrderNo();
        }
    }
}
